// 引入所有需要注册的全局组件

// 自封
import WangForm from '@/components/wang/form/index.vue'
import WangTitle from '@/components/wang/wangTitle/index.vue'
import WangSearch from '@/components/wang/search/index.vue'
import WangPage from '@/components/wang/page/index.vue'
import WangDialogDrag from '@/components/wang/wangDialogDrag/index.vue'
import Viewer from 'v-viewer'
import 'viewerjs/dist/viewer.css'
const globalComponents = [
  WangForm,
  WangTitle,
  WangSearch,
  WangPage,
  WangDialogDrag
]

export default {
  install(Vue) {
    globalComponents.forEach((component) => {
      // 这里用的是组件里面的name
      // 如果引入的组件没有写name，会报错 ： vue.esm.js:100 Uncaught TypeError: Cannot read properties of undefined (reading 'toLowerCase')
      Vue.component(component.name, component)
    })
    Vue.use(Viewer)
  }
}
